package nongchang.kuaijiecaifu.com.ncapp_android.ui.lifeshopfragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.BindView;
import butterknife.ButterKnife;
import nongchang.kuaijiecaifu.com.ncapp_android.R;
import nongchang.kuaijiecaifu.com.ncapp_android.common.fragment.BaseFragment;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.detailfragment.VerticalFragment1;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.detailfragment.VerticalFragment3;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.widget.DragLayout;

/**
 * Created by Administrator on 2016/3/11 0011.
 */
public class LifeShopDetailFragment extends BaseFragment {
    private VerticalFragment1 fragment1;
    private VerticalFragment3 fragment3;
    @BindView(R.id.draglayout)
    DragLayout draglayout;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_business_discount, container, false);
        return view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ButterKnife.bind(this, getView());
        fragment1 = new VerticalFragment1();
        fragment3 = new VerticalFragment3();
        getFragmentManager().beginTransaction()
                .add(R.id.first, fragment1).add(R.id.second, fragment3)
                .commit();

        DragLayout.ShowNextPageNotifier nextIntf = new DragLayout.ShowNextPageNotifier() {
            @Override
            public void onDragNext() {
                fragment3.initView();
            }
        };
        draglayout.setNextPageListener(nextIntf);
    }
}
